<%@ page language="java" import="java.util.*" pageEncoding="UTF-8" %>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
	<title></title>
	<%@include file="/view/resource.jsp" %>
	<link rel="stylesheet" type="text/css" href="${ctx}/css/base.css">
</head>
<body>
<form id="entityForm" name="entityForm" action="${ctx}/alarm/process"
      method="POST">
	<input type="hidden" name="alarmId" value="${alarmId}"/>
	<input type="hidden" name="alarmDate" value="${alarmDate}"/>
	<table class="editTable">
		<tr>
			<td class="label" style="width: 60px;min-width: 60px;height: 35px;">显示名称:</td>
			<td>
				${equipName}
			</td>
		</tr>
		<tr>
			<td class="label" style="width: 60px;min-width: 60px;height: 35px;">设备号:</td>
			<td>
				${alarm.simNo}
			</td>
		</tr>
		<tr>
			<td class="label" style="width: 60px;min-width: 60px;height: 35px;">报警类型:</td>
			<td>
				${alarmTypeDesc}
			</td>
		</tr>
		<tr>
			<td class="label" style="width: 60px;min-width: 60px;height: 35px;">报警时间:</td>
			<td>
				${alarmDate}
			</td>
		</tr>
		<tr>
			<td class="label" style="width: 60px;min-width: 60px;height: 35px;">报警来源:</td>
			<td>
				${alarmSourceDesc}
			</td>
		</tr>
	</table>
</form>
<div style="border-width:0px;background:#fff;padding-top: 15px;" class="dialog-button">
	<a href="#" id="btnSave" class="topjui-menubutton" data-options="iconCls:'fa fa-trash',
           btnCls:'topjui-btn'">解除报警</a>
</div>
<script type="text/javascript" src="${ctx}/js/common/package.js"></script>
<script type="text/javascript" src="${ctx}/js/common/base.js?v=11"></script>
<script type="text/javascript" src="${ctx}/js/common/utility.js"></script>
<script>
	// 对Date的扩展，将 Date 转化为指定格式的String
	// 月(M)、日(d)、小时(h)、分(m)、秒(s)、季度(q) 可以用 1-2 个占位符，
	// 年(y)可以用 1-4 个占位符，毫秒(S)只能用 1 个占位符(是 1-3 位的数字)
	// 例子：
	// (new Date()).Format("yyyy-MM-dd hh:mm:ss.S") ==> 2006-07-02 08:09:04.423
	// (new Date()).Format("yyyy-M-d h:m:s.S")      ==> 2006-7-2 8:9:4.18
	Date.prototype.Format = function (fmt) { //author: meizz
		var o = {
			"M+": this.getMonth() + 1, //月份
			"d+": this.getDate(), //日
			"h+": this.getHours(), //小时
			"m+": this.getMinutes(), //分
			"s+": this.getSeconds(), //秒
			"q+": Math.floor((this.getMonth() + 3) / 3), //季度
			"S": this.getMilliseconds() //毫秒
		};
		if (/(y+)/.test(fmt)) fmt = fmt.replace(RegExp.$1, (this.getFullYear() + "").substr(4 - RegExp.$1.length));
		for (var k in o)
			if (new RegExp("(" + k + ")").test(fmt)) fmt = fmt.replace(RegExp.$1, (RegExp.$1.length == 1) ? (o[k]) : (("00" + o[k]).substr(("" + o[k]).length)));
		return fmt;
	}

	$(function () {
		var alarmId = "${alarmId}";
		var data = {};
		//alert(strPoints);
		$("#btnSave").click(function () {
			Bdth.submitForm($("#entityForm"), data, function (result) {
				if (result.success) {
					$.iMessager.alert('提示', '报警已处理.', 'messager-info');
				}
				else {
					$.iMessager.alert("提示", "保存失败，错误:" + result.msg, 'messager-error');
				}
				parent.closeCommandWindow();
				parent.$("#alarmDataGrid").datagrid('load');
			});

		})
	});
</script>
</body>
</html>
